package com.jilujia.domain.question.repository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.jilujia.domain.question.AnswerComment;
import com.jilujia.framework.domain.JpaBusinessRepository;

@Repository
@Transactional(readOnly = true)
public interface AnswerCommentRepository extends JpaBusinessRepository<Long, AnswerComment> {

	@Query("select a from AnswerComment a where a.answer.id = :answerId")
	Page<AnswerComment> findAnswerCommentsByAnswerId(@Param("answerId") Long answerId, Pageable pageable);
}
